package collegemenu;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ScrollPaneConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.Component;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
// 성적조회
public class Sungjuk extends JPanel {
	private JTable table;
	private JTextField totb;
		
	public Sungjuk() {
		table();
		panel();
		
	}
	
private void table(){
	String[] sung = {"과목명","담당교수","총점","학점"};
	String[][] sungt = {{"물리","아무개","90","2"},
	 					{"물리","아미개","80","2"},
	 					{"물리","아루루","70","2"},
	 					{"물리","이로로","50","2"}};
	
	DefaultTableModel model = new DefaultTableModel(sungt,sung);
	setLayout(new BorderLayout(0, 0));
	
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
	
	table = new JTable(model);
	scrollPane.setViewportView(table);
	add( scrollPane);
	
}
private void panel(){
	JPanel panel = new JPanel();
	add(panel, BorderLayout.SOUTH);
	panel.setLayout(new BorderLayout(0, 0));
	
	JPanel panel_1 = new JPanel();
	panel.add(panel_1, BorderLayout.EAST);
	
	JLabel tot = new JLabel("총학점");
	panel_1.add(tot);
	
	totb = new JTextField();
	panel_1.add(totb);
	totb.setColumns(10);
}
}